package com.mall.service;

import com.mall.dto.*;
import com.mall.entity.OmsOrder;
import com.mall.dto.*;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author zzx
 * @since 2022-06-15
 */
public interface OmsOrderService extends IService<OmsOrder> {


    /**
     * 修改或新增订单
     * @param order
     * @return
     */
    boolean Save(OmsOrder order);

    /**
     * 订单查询
     */
    List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum);

    /**
     * 批量发货
     */
    @Transactional
    int delivery(List<OmsOrderDeliveryParam> deliveryParamList);

    /**
     * 批量关闭订单
     */
    @Transactional
    int close(List<Long> ids, String note);

    /**
     * 批量删除订单
     */
    int delete(List<Long> ids);

    /**
     * 获取指定订单详情
     */
    OmsOrderDetail detail(Long id);

    /**
     * 修改订单收货人信息
     */
    @Transactional
    int updateReceiverInfo(OmsReceiverInfoParam receiverInfoParam);

    /**
     * 修改订单费用信息
     */
    @Transactional
    int updateMoneyInfo(OmsMoneyInfoParam moneyInfoParam);

    /**
     * 修改订单备注
     */
    @Transactional
    int updateNote(Long id, String note, Integer status);

    /**
     * 获取当前订单表的最大值
     * @return
     */
    @Transactional
    Long getMax();

    /**
     * 根据用户ID查询订单
     */
    List<FrontOrderDto> getOrderByMemberId(Long id, int pageSize, int pageNum);



    /**
     * 确认收货
     */
    @Transactional
    int confirm(Long id);


    /**
     * 确认收货
     */
    @Transactional
    int pay(Long id,int payType);
}
